package com.example.springboot_zc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot_zc.pojo.classDis;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Set;

@Mapper
public interface classDisMapper extends BaseMapper<classDis> {
    @Select("select class_num from class_dis")
    public Set<String> selectClassNum();

    @Select("select count(*) from class_dis where class_num=#{class_num} and status=#{status}")
    public Integer getStatusNum(String class_num,String status);

    @Select("select count(*) from class_dis where status=#{status}")
    public Integer getSN(String status);

    @Delete("delete from class_dis where stu_num=#{stuNum}")
    public void deleteByStu(String stuNUm);

    @Update("update class_dis set status=#{status} where stu_num=#{stuNum}")
    public boolean updateSta(String status,String stuNum);
}
